//
//  WBAccount.m
//  weibo
//
//  Created by DYC on 16/7/4.
//  Copyright © 2016年 DP. All rights reserved.
//

#import "WBAccount.h"

@implementation WBAccount

+ (instancetype)wbAccountWithDic:(NSDictionary *)dic {
    
    return [[self alloc] initWithDic:dic];
}


- (instancetype)initWithDic:(NSDictionary *)dic {
    
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}


- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:self.wbToken forKey:@"wbToken"];
    [aCoder encodeObject:self.wbRefrshToken forKey:@"wbRefrshToken"];
    [aCoder encodeObject:self.wbCurrentID forKey:@"wbCurrentID"];
    [aCoder encodeObject:self.wbExpirationDate forKey:@"wbExpirationDate"];
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    
    if (self = [super init]) {
        self.wbToken = [aDecoder decodeObjectForKey:@"wbToken"];
        self.wbRefrshToken = [aDecoder decodeObjectForKey:@"wbRefrshToken"];
        self.wbCurrentID = [aDecoder decodeObjectForKey:@"wbCurrentID"];
        self.wbExpirationDate = [aDecoder decodeObjectForKey:@"wbExpirationDate"];
    }
    return self;
}

@end
